#ifndef __PLAYER_EVENT_H__
#define __PLAYER_EVENT_H__

#include "Server/Events.h"

using namespace PocketSurvival;

namespace BedWars
{
    class BedWarsCore;

    class PlayerEvent : public IPlayerEvent, public ICreatureEvent
    {
    private:
        BedWarsCore *m_bedWarsCore;

    public:
        PlayerEvent(BedWarsCore * bedWarsCore);
        virtual bool cmdFrontMessage(std::shared_ptr<PlayerData> playerData, const std::string &message, std::vector<uint8_t> &toClients) override;
        virtual bool playerMove(std::shared_ptr<PlayerData> playerData, const Vector3 &position) override;
        virtual bool playerPlaceBlock(ComponentPlayer *componentPlayer, const Point3 &point, int32_t placeBlockValue) override;
        virtual bool playerBreakBlock(ComponentPlayer *componentPlayer, const Point3 &point, int32_t digBlockValue, int32_t toolLevel) override;
        virtual void playerRestart(ComponentPlayer* componentPlayer) override;
        virtual bool onUse(ComponentMiner *componentMiner, const Ray3& ray) override;


        virtual bool hitBody(ComponentAttacker* attacker, ComponentBody *body, const Vector3 &hitPosition, const Vector3 &hitDirection) override;
        virtual bool injureEntity(ComponentHealth *health, float amount, entt::entity attackerEntity, bool realInjure, const std::string &cause, InjureType injureType) override;
        virtual bool entityDeath(ComponentHealth *health, float amount, entt::entity attackerEntity, const std::string &cause) override;
    };

    inline PlayerEvent::PlayerEvent(BedWarsCore * bedWarsCore) : m_bedWarsCore(bedWarsCore) {}

} // namespace BedWars

#endif
